package com.wuyou.dynamic.service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.wuyou.dynamic.entity.Statement;
import com.wuyou.dynamic.mapper.StatementMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.Serializable;

/**
 * StatementService
 *
 * @Date 2025-11-06 15:01
 * @Author 无忧
 */
@Service
public class StatementService {


    private StatementMapper statementMapper;

    @Autowired
    public void setStatementMapper(StatementMapper statementMapper) {
        this.statementMapper = statementMapper;
    }

    @DS(value = "master")
    public Statement getById(Serializable id){
        return statementMapper.selectById(id);
    }
    @DS(value = "slave1")
    public Statement getById1(Serializable id){
        return statementMapper.selectById(id);
    }

}
